<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>{% block page_title %}{% endblock %}-任务收集平台</title>
    <link rel="shortcut icon" type="image/x-icon" href="{{ url_for('static',filename='image/favicon.ico') }}">
    <link href="{{ url_for('static',filename='css/bootstrap.min.css') }}" rel="stylesheet">
    {% block page_css %} {% endblock %}
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <div id="container">
        <!--导航条-->
        {% block navbar %}
        <div class="navbar navbar-default navbar-fixed-top">        
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse"><!--小于768px时显示-->
                    <span class="sr-only"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
            <div class="collapse navbar-collapse navbar-responsive-collapse">
                <ul class="nav navbar-nav">
                    <li><a href="{{ url_for('main.taskList') }}">任务列表</a></li>
                    <li><a href="{{ url_for('main.documents') }}">文档下载</a></li>
                </ul>
                 <div class="navbar-form navbar-right">
                    <a class="btn btn-link" data-toggle="modal" data-target=".popupCSS"><span class="glyphicon glyphicon-user"></span>&nbsp;{{ current_user.username }}
                    </a>
                    {% if current_user.isAdmin() %}
                    <a href="{{ url_for('main.addTask') }}" class="btn btn-link"><span class="glyphicon glyphicon-plus-sign"></span>&nbsp;添加任务
                    </a>
                    {% endif %}
                    {% if current_user.is_authenticated %}
                    <a href="{{ url_for('main.changePassword') }}" class="btn btn-link"><span class="glyphicon glyphicon-lock"></span>&nbsp;修改密码
                    </a>
                    <a href="{{ url_for('main.logout') }}" class="btn btn-link"><span class="glyphicon glyphicon-log-out"></span>&nbsp;退出
                    </a>
                    {% endif %}
                </div>
            </div>
        </div>
        {% endblock %}
        
        {% block page_flash %}
        <!-- flash 消息提示 -->
        {% for category,message in get_flashed_messages(with_categories=True) %}
            <script>alert("{{ message  }}");</script>
        {% endfor %}
        {% endblock %}

        <!-- 页面内容 -->
        {% block page_content %}{% endblock %}
              
    </div>  <!-- container End -->

    <!-- 页面脚本 -->

    <script src="{{ url_for('static',filename='js/jquery-2.1.4.js') }}"></script>
    <script src="{{ url_for('static',filename='js/bootstrap.min.js') }}"></script>
    {% block page_script %}{% endblock %}

</body>
</html>
